package com.jiexin.util;

import java.util.Properties;

/**
 * @Author: Jay_Liu
 * @Description: 配置文件获取键值
 * @Date: Created in 20:44 2018/7/19
 * @Modified By:
 */
public final class ConfigUtil {

    /**
     * 配置文件路径
     */
    private static String CONFIG_PROPS = "application.yml";
    private static Properties props;

    static {
        props = PropsUtil.loadProps(CONFIG_PROPS);
    }


    /**
     * 获取待解析文件路径
     * @return 待解析文件路径
     */
    public static String getSrcFilePath(){
        return PropsUtil.getString(props,"srcFilePath").trim();
    }


    /**
     * 获取解析失败文件路径
     * @return 解析失败文件路径
     */
    public static String getFileBackupPath(){
        return PropsUtil.getString(props,"failBackup").trim();
    }

    /**
     * 获取解析成功文件路径
     * @return 解析成功文件路径
     */
    public static String getSuccessBackupPath(){
        return PropsUtil.getString(props,"successBackup").trim();
    }

    /**
     * 获取word存放主路径
     * @return word存放主路径
     */
    public static String getTempPath(){
        return PropsUtil.getString(props,"tempPath").trim();
    }

    public static String getMailAccount() {
        return PropsUtil.getString(props, "mailAccount").trim();
    }

    public static String getMailPassword() {
        return PropsUtil.getString(props, "mailPassword").trim();
    }

    public static String getMailHost() {
        return PropsUtil.getString(props, "mailHost").trim();
    }

    public static String getDshMailSubject() {
        return PropsUtil.getString(props, "dshMailSubject").trim();
    }

    public static String getCatMailSubject() {
        return PropsUtil.getString(props, "catMailSubject").trim();
    }

    public static String getAdminEmails() {
        return PropsUtil.getString(props, "adminEmails").trim();
    }


    /**
     * 获取命名空间
     * @return
     */
    public static String getNamespace()
    {
        return PropsUtil.getString(props, "axml.namespace").trim();
    }
    /**
     * 获取根节点
     * @return
     */
    public static String getRootNodes() {

        return PropsUtil.getString(props, "xpath.filter.root.nodes").trim();
    }

    public static String getAffectItem() {

        return PropsUtil.getString(props, "xpath.filter.affected.items").trim();
    }

    public static String getSites() {

        return PropsUtil.getString(props, "xpath.filter.sites").trim();
    }


    public static String getBom() {

        return PropsUtil.getString(props, "xpath.filter.bom").trim();
    }

    public static String getQuoteTableName() {

        return PropsUtil.getString(props, "quote.table.name").trim();
    }
}
